<?php
    include './public/db_object.php';

    
    if(isset($_POST)){
        $uid = $_POST['uid'];
        $gid_all = $_POST['gid_all'];
        $state = $_POST['state'];

        // 生成订单号
        $order = 'DJC-'.date('YmdHis').rand(10000000, 99999999);
        //echo $order;
        $db = new DB_object(['db_name'=> 'db_shop']);

        $res = $db->l_insert_one('t_order', ["null", "'$uid'", "'$gid_all'", "'$order'", "now()", "'$state'"]);

        if($res){
            echo 1;
        }
    }

?>